/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include "FrameSet.h"

namespace liba
{
namespace lib2d
{
namespace objects
{

bool FrameSetRep::Frame::on_attribute( xml::Provider * prov, const String & name, const String & value )
{
	if( name == "Rect" )
		return converter::convert( value, &rect );
	return true;
}

bool FrameSetRep::on_attribute( xml::Provider * prov, const String & name, const String & value )
{
	if( name == "Image" )
	{
		image = new ImageSimple( value );
		return true;
	}
	return false;
}

bool FrameSetRep::on_node( xml::Provider * prov, const String & name )
{
	if( name == "Frame" )
	{
		frames.push_back( Frame() );
		return prov->parse_object( &frames.back() );
	}
	return false;
}

} //namespace objects
} //namespace lib2d
} //namespace liba

